From: Keir Fraser Date: Mon, 20 Oct 2008 15:49:25 +0000 (+0100) Subject: x86: Add TLB flushing to HAP p2m changes X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14066^2~17 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=e7f7c7b12b045bbc5f37649e285c286e04cd1aa3;p=xen.git x86: Add TLB flushing to HAP p2m changes Removing an MFN from the p2m requires it to be flushed from the guest's TLBs on HAP, like we do when we're using shadows. Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 2556a6ea9e..e063e086d8 100644 --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -639,9 +639,16 @@ static void hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p, mfn_t table_mfn, l1_pgentry_t new, unsigned int level) { + uint32_t old_flags; + hap_lock(v->domain); + old_flags = l1e_get_flags(*p); safe_write_pte(p, new); + if ( (old_flags & _PAGE_PRESENT) + && (level == 1 || (level == 2 && (old_flags & _PAGE_PSE))) ) + flush_tlb_mask(v->domain->domain_dirty_cpumask); + #if CONFIG_PAGING_LEVELS == 3 /* install P2M in monitor table for PAE Xen */ if ( level == 3 )